import router from 'umi/router';

export const dva = {
  config: {
    onError(err) {
      err.preventDefault();
      console.error(err.message);
    },
  },
};

export function onRouteChange({ location, routes, action }) {
  console.log('路由变化', location, routes, action);
  if (!localStorage.getItem('token')) {
    router.push('/'); //进行路由拦截校验
  }
}
// export function render(oldRender) {
//         oldRender();
// }
